// 全局样式
@import 'breakpoints';
@import 'variables';

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #0a0a0a;
  color: #ffffff;
  line-height: 1.6;
}

// 断点定义
$breakpoints: (
  'mobile': 768px,
  'tablet': 1024px,
  'desktop': 1200px,
  'wide': 1440px
);

// 响应式混入
@mixin respond-to($breakpoint) {
  @if map-has-key($breakpoints, $breakpoint) {
    @media (min-width: map-get($breakpoints, $breakpoint)) {
      @content;
    }
  }
}

// 变量定义
:root {
  --primary-color: #3b82f6;
  --secondary-color: #6366f1;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #06b6d4;
  
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;
  
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --border-color: #374151;
  --border-light: #4b5563;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

// 工具类
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem;
  
  @include respond-to('tablet') {
    padding: 0 2rem;
  }
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  
  &--primary {
    background: var(--primary-color);
    color: white;
    
    &:hover {
      background: #2563eb;
    }
  }
  
  &--secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    
    &:hover {
      background: var(--bg-secondary);
      border-color: var(--border-light);
    }
  }
  
  &--active {
    background: var(--primary-color);
    color: white;
  }
}

// 网格布局
.grid {
  display: grid;
  gap: 1rem;
  
  &--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  &--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  &--4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  @include respond-to('mobile') {
    &--2 {
      grid-template-columns: 1fr;
    }
    
    &--3 {
      grid-template-columns: repeat(2, 1fr);
    }
    
    &--4 {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @include respond-to('tablet') {
    &--3 {
      grid-template-columns: repeat(3, 1fr);
    }
    
    &--4 {
      grid-template-columns: repeat(3, 1fr);
    }
  }
  
  @include respond-to('desktop') {
    &--4 {
      grid-template-columns: repeat(4, 1fr);
    }
  }
}
